﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business;
using Foundation;

namespace RPGSoundmixer.SoundSuiteConfiguration {
   public class SoundSuiteConfigurationPresenter : BasePresenter<ISoundSuiteConfigurationView>{       

#if DEBUG
       public IDataHandler DataStub {
           set {
               this.model = value;
               this.model.PropertyChanged+=new System.ComponentModel.PropertyChangedEventHandler(model_PropertyChanged);
           }
       }
#endif 

       public SoundSuiteConfigurationPresenter(ISoundSuiteConfigurationView view)
           : base(view) {
           this.model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(model_PropertyChanged);
       }

       void model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
           if (e.PropertyName.Equals("CurrentSoundSuite")) {
               SoundSuite suite = this.model.GetCurrentSoundSuite();
               if(suite != null){
                   this.view.SoundSuite = suite; 
               }               
           }
       }
   }
}
